/*
 *  MapElement.h
 *  Rempart
 *
 *
 */

#ifndef _MAPELEMENT_H
#define _MAPELEMENT_H

#include <SFML/Graphics.hpp>
#include "Constants.h"
#include "Indexable.h"
#include "RessourcesManager.h"

class MapElement : public sf::Sprite, public Indexable{
protected:

	bool checked;
	int elementType;
	bool mouseOver;		
	bool visible;
	bool secured;
	
	
	
	
	static const int width = 30;
	static const int heigth = 30;
	
public:
	enum ElementType {
		empty,
		ground,
		water,
		tower,
		canon,
		wall,
		boat,
		killedBoat
	};
	
	enum sides {
		top,
		right,
		bottom,
		left
	};
	
	
	
	// Constructeur et destructeur
	MapElement();
	~MapElement();
	
	
	// Accesseurs
	static int getWidth();	
	static int getHeigth();
	
	int getElementType();
	
	bool isMouseOver();
	bool isVisible();
	
	void setVisible();
	void unsetVisible();
	
	virtual void setSecured();
	virtual void unsetSecured();
	bool isSecured();

	virtual void setMouseOver(bool collision=false);
	virtual void unsetMouseOver();
	
	void setChecked();
	void unsetChecked();
	bool isChecked();
	
	virtual void resetDefaultSurface();
	bool isMouseOvered();
	
	sf::Vector2<int> getMapPosition();


	
};

#endif